import { Ref } from '@vue/runtime-dom'
import { realnameRequst, HyRequestWxLive, HyRequest } from '../index'
import { LiveInfoResult, getRoleListRes } from './type'

// 枚举类型
enum MainApi {
  // 用户
  UserUpdate = '/services/app/User/Update',
  UserGetAll = '/services/app/User/GetAll',
  UserCreate = '/services/app/User/Create',
  UserDelete = '/services/app/User/Delete',
  //角色
  RoleGetAll = '/services/app/Role/GetAll',
  RoleUpdate = '/services/app/Role/Update',
  RoleCreate = '/services/app/User/Create',
  RoleDelete = '/services/app/Role/Delete',
  // 租户
  TenantCreate = '/services/app/Tenant/Create',
  TenantUpdate = '/services/app/Tenant/Update',
  TenantGetAll = '/services/app/Tenant/GetAll',
  TenantDelete = '/services/app/Tenant/Delete',
}
type SN = number | string
interface IUser {
  maxResultCount: SN
  skipCount: SN
}
interface IRole {
  keyword: SN
  maxResultCount: SN
  skipCount: SN
}
interface ITenant {
  keyword: SN
  maxResultCount: SN
  skipCount: SN
}

// 获取用户表格user
export function UserGetAll(user: IUser): any {
  return HyRequest.get({
    url: MainApi.UserGetAll,
    params: user,
  })
}
// 获取角色表格role
export function RoleGetAll(role: IRole): any {
  return HyRequest.get({
    url: MainApi.RoleGetAll,
    params: role,
  })
}
// 获取租户表格
export function TenantGetAll(tenant: ITenant): any {
  return HyRequest.get({
    url: MainApi.TenantGetAll,
    params: tenant,
  })
}

// 删除用户表格user
export function UserDelete(Id: SN): any {
  return HyRequest.delete({
    url: MainApi.UserDelete,
    params: {
      Id,
    },
  })
}
// 删除角色表格user
export function RoleDelete(Id: SN): any {
  return HyRequest.delete({
    url: MainApi.RoleDelete,
    params: {
      Id,
    },
  })
}
// 删除租户表格user
export function TenantDelete(Id: SN): any {
  return HyRequest.delete({
    url: MainApi.TenantDelete,
    params: {
      Id,
    },
  })
}
